package com.tank.jdk8.methodreference;

/**
 * Created with IntelliJ IDEA.
 * User: SuQiEr
 * Date:2017/1/26
 * Time: 19:30
 * To change this template use File | Settings | File Templates.
 */
public class Animal {

    private String name;

    private Integer age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Animal() {
    }

    public Animal(String name, Integer age) {
        this.name = name;
        this.age = age;
    }
      public static int comparatorByAge(Animal animal,Animal animal2){
          return animal.getAge()-animal2.getAge();
      }

    public int comparatorAge(Animal animal){
        return this.getAge()-animal.getAge();
    }


}

